package com.ja.openchat.ui.message.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.ja.openchat.R;
import com.ja.openchat.views.PriseFlowLayout;
import com.zy.openchat.Constants;
import com.zy.openchat.core.model.message.MessageReaction;

import java.util.List;

public class MessageReactionAdapter extends BaseQuickAdapter<MessageReaction, BaseViewHolder> {

    public MessageReactionAdapter( @Nullable List<MessageReaction> data) {
        super(R.layout.item_message_reaction, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, MessageReaction item) {
        ImageView emojiImage = helper.getView(R.id.emojiImage);
        emojiImage.setImageDrawable(Constants.getReactionDrawableById(item.reactionId));
        PriseFlowLayout flow_layout = helper.getView(R.id.flow_layout);
        flow_layout.setUrls(item.userIds);
    }
}
